package com.yonyou.cyxdms.basedata.service.scheduler;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yonyou.cyxdms.basedata.service.service.sap.SapProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * DMS从SAP获取所有选装数据
 * 执行时间：当日3：00
 */
@Component
@Slf4j
public class GetAllOptionJob {

    @Autowired
    SapProductService sapProductService;

    @XxlJob(value = "getAllOptionJob")
    public ReturnT<String> process(String param) throws Exception {
        log.info("===================获取选装数据getAllOptionJob开始===================");
        param = XxlJobHelper.getJobParam();
        log.info("执行参数param:{}", param);
        sapProductService.getOptionInfo(param);
        log.info("===================获取选装数据getAllOptionJob结束===================");
        return ReturnT.SUCCESS;
    }

}
